#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <QFileDialog>
#include <QFile>
#include <QStringList>
#include <QWidget>

#include <iostream>

#include "aboutdialog.h"
#include "closetabdialog.h"
#include "defines.h"

namespace Ui
{
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

    //Receive da widget
private slots:
    void onDockCompileHelp(bool checked);
    void onDockOutput(bool checked);
    void onOpenFile();
    void onSaveFile();
    void onSaveAllFile();
    void onClose();
    void onCloseAll();
    void onCloseAllButMe();
    void onQuit();
    void onAbout();
    void onRunProgram();
    void on26Version(bool checked);
    void on31Version(bool checked);
    void onTabCloseRequest(int index);

    //Sub da altre classi
private slots:
    void subSaveClosingTab();
    void subDiscardClosingTab();


private:
    void closeEvent ( QCloseEvent * event );
    void closeOperation();
    void loadFiles();

private:
    Ui::MainWindow *ui;
    int indexed_tab;
    int tab_number;
    bool is_first_tab;
    QFileDialog * file_selection_dialog;
    AboutDialog * about_dialog;
    QStringList fileNames;
    bool isV26Used;
    closetabdialog * save_dialog;
    int closing_tab;
    QStringList * openedFiles;
    QVector <ScriptEditInfo> script_info;
};

#endif // MAINWINDOW_H
